<?php
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;

class CreateAdminTable extends Migration
{

	/**
	 * Run the migrations.
	 *
	 * @return void
	 */
	public function up()
	{
		// 管理员。
		Schema::create('admins', function (Blueprint $table)
		{
			$table->engine = 'InnoDB';

			$table->increments('id');

			// 用户名
			$table->string('username', 100)->unique();

			// 手机号
			$table->string('mobile', 20)
				->unique()
				->nullable();

			// 邮箱
			$table->string('email', 100)
				->unique()
				->nullable();

			// 密码
			$table->string('password', 64);

			// 头像
			$table->char('avatar_id', 18)->default('');

			// 真实姓名。
			$table->string('realname', 100)->default('');

			// remember_token
			$table->string('remember_token', 100)->nullable();

			$table->timestamps();
			$table->softDeletes();
			$table->index('deleted_at');
		});
	}

	/**
	 * Reverse the migrations.
	 *
	 * @return void
	 */
	public function down()
	{
		Schema::drop('admins');
	}
}
